<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>医院病房管理系统 - 登录</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" th:href="@{/css/login.css}">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
</head>
<body>
    <div class="login-container">
        <div class="login-box">
            <div class="login-header">
                <div class="logo">
                    <i class="fas fa-hospital"></i>
                </div>
                <h1>医院病房管理系统</h1>
            </div>
            <div class="role-select">
                <label>
                    <input type="radio" name="role" value="doctor" checked onclick="switchRole('doctor')">
                    <i></i>
                    <span><i class="fas fa-user-md"></i> 医生登录</span>
                </label>
                <label>
                    <input type="radio" name="role" value="admin" onclick="switchRole('admin')">
                    <i></i>
                    <span><i class="fas fa-user-shield"></i> 管理员登录</span>
                </label>
            </div>
            <form th:action="@{/doctor/auth/login}" method="post" class="login-form" id="doctorForm">
                <div class="form-group">
                    <div class="input-group">
                        <i class="fas fa-user"></i>
                        <input type="text" id="doctorId" name="doctorId" placeholder="请输入工号" required>
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <i class="fas fa-lock"></i>
                        <input type="password" id="password" name="password" placeholder="请输入密码" required>
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="login-btn">医生登录</button>
                </div>
                <div class="error-message" th:if="${error != null}">
                    <i class="fas fa-exclamation-circle"></i>
                    <span th:text="${error}"></span>
                </div>
            </form>
            
            <form th:action="@{/admin/auth/login}" method="post" class="login-form" id="adminForm" style="display:none;">
                <div class="form-group">
                    <div class="input-group">
                        <i class="fas fa-user"></i>
                        <input type="text" id="adminUsername" name="username" placeholder="请输入管理员账号" required>
                    </div>
                </div>
                <div class="form-group">
                    <div class="input-group">
                        <i class="fas fa-lock"></i>
                        <input type="password" id="adminPassword" name="password" placeholder="请输入密码" required>
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="login-btn">管理员登录</button>
                </div>
                <div class="error-message" th:if="${error != null}">
                    <i class="fas fa-exclamation-circle"></i>
                    <span th:text="${error}"></span>
                </div>
            </form>
        </div>
    </div>
    
    <script>
    function switchRole(role) {
        if (role === 'admin') {
            document.getElementById('adminForm').style.display = 'block';
            document.getElementById('doctorForm').style.display = 'none';
        } else {
            document.getElementById('adminForm').style.display = 'none';
            document.getElementById('doctorForm').style.display = 'block';
        }
    }
    </script>
</body>
</html> 